package com.ruoyi.equ.service.impl;


import com.ruoyi.equ.domain.EquColInfo;
import com.ruoyi.equ.domain.EquCollect;
import com.ruoyi.equ.mapper.EquCollectMapper;
import com.ruoyi.equ.service.IEquCollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 设备领用Service业务层处理
 * 
 * @author luguanqing
 * @date 2020-10-23
 */
@Service
public class EquCollectServiceImpl implements IEquCollectService
{
    @Autowired(required = false)
    private EquCollectMapper equCollectMapper;

    /**
     * 查询设备领用
     * 
     * @param id 设备领用ID
     * @return 设备领用
     */
    @Override
    public EquCollect selectEquCollectById(String id)
    {
        return equCollectMapper.selectEquCollectById(id);
    }


    /**
     * 根据设备领用单号获取设备领用信息
     * @param colNum 设备领用单号
     * @return
     */
    @Override
    public List<EquColInfo> selectEquCollectByColNum(String colNum, String state) {
        return equCollectMapper.selectEquCollectByColNum(colNum, state);
    }

    /**
     * 查询设备领用列表
     * 
     * @param equCollect 设备领用
     * @return 设备领用
     */
    @Override
    public List<EquCollect> selectEquCollectList(EquCollect equCollect)
    {
        return equCollectMapper.selectEquCollectList(equCollect);
    }

    /**
     * 设备列表
     * @param colNum 设备编号
     * @return
     */
    @Override
    public List<EquCollect> selectEquCollectNum(String colNum) {
        return equCollectMapper.selectEquCollectNum(colNum);
    }

    /**
     * 新增设备领用
     * 
     * @param equCollect 设备领用
     * @return 结果
     */
    @Override
    public int insertEquCollect(EquCollect equCollect)
    {
        return equCollectMapper.insertEquCollect(equCollect);
    }


    /**
     *
     * @param equCollects 设备领用集合
     * @return
     */
    @Override
    public int insertEqus(List<EquCollect> equCollects) {
        return equCollectMapper.insertEqus(equCollects);
    }

    /**
     * 修改设备领用
     * 
     * @param equCollect 设备领用
     * @return 结果
     */
    @Override
    public int updateEquCollect(EquCollect equCollect)
    {
        return equCollectMapper.updateEquCollect(equCollect);
    }

    /**
     * 根据设备号查询用户信息
     * @param equNum 设备领用单号
     * @param state
     * @return
     */
    @Override
    public String selectUserByEquNum(String equNum, String state) {
        return equCollectMapper.selectUserByEquNum(equNum, state);
    }


    /**
     * 根据单号更新设备信息
     * @param equCollect 设备领用
     * @return
     */
    @Override
    public int updateEquCollectByColNum(EquCollect equCollect) {
        return equCollectMapper.updateEquCollectByColNum(equCollect);
    }

    /**
     * 批量删除设备领用
     * 
     * @param ids 需要删除的设备领用ID
     * @return 结果
     */
    @Override
    public int deleteEquCollectByIds(String[] ids)
    {
        return equCollectMapper.deleteEquCollectByIds(ids);
    }

    /**
     * 根据单号删除领用设备信息
     * @param colNum 单号id
     * @return
     */
    @Override
    public int deleteEquCollectByColNum(String colNum) {
        return equCollectMapper.deleteEquCollectByColNum(colNum);
    }

    /**
     * 删除设备领用信息
     * 
     * @param id 设备领用ID
     * @return 结果
     */
    @Override
    public int deleteEquCollectById(String id)
    {
        return equCollectMapper.deleteEquCollectById(id);
    }
}
